package com.dalin.framework.util;


import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

/**
 * Created by Administrator on 2015/11/4.
 */
public class SqlUtils {

	private static final LogUtil LOG_UTIL = LogUtil.getLogger(SqlUtils.class);

	private static Properties props = new Properties();

	private static final String FILE_PATH = "./sqlmap/sql.properties";

	static {
		String path = SqlUtils.class.getClassLoader().getResource("").getPath() + FILE_PATH;
		load(path);
	}

	private static void load(String path) {
		try {
			InputStream in = new BufferedInputStream(new FileInputStream(path));
			props.load(in);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static String getValue(String key) {
		return props.getProperty(key);
	}

}
